﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DataValidateAttribute
{
    public class ValidationAgeAttribute : ValidateAttribute
    {
        public ValidationAgeAttribute()
        {

        }
        public ValidationAgeAttribute(string msg) : base(msg)
        {

        }
        public override void IsValidation(object value)
        {
            int age = Convert.ToInt32(value);

            if (age <= 0)
            {
                throw new ArgumentException(this.ArgumentName + " " + this.Message);
            }
        }
    }
}
